<template>
  <div>
    <BasicTable @register="registerTable">
      <template #detail="{ text }">
        <div v-html="text"></div>
      </template>
    </BasicTable>
  </div>
</template>

<script lang="ts" setup>
import { BasicColumn, BasicTable, useTable } from '@/components/Table';
import { getChangeLog } from '@/api/sys/busComponentManage';

const columns: BasicColumn[] = [
  {
    title: '修改人',
    dataIndex: 'createUser',
    width: 140,
  },
  {
    title: '修改时间',
    dataIndex: 'createTime',
    width: 200,
  },
  {
    title: '详情',
    dataIndex: 'changeContent',
    slots: {
      customRender: 'detail',
    },
  },
];
const [registerTable, { reload }] = useTable({
  tableKey: 'amsCustomer:page',
  api: getChangeLog,
  columns,
  useSearchForm: false,
  showTableSetting: false,
  bordered: true,
  showIndexColumn: true,
});

const loadByBusId = (busId: string) => {
  reload({
    searchInfo: {
      busId,
    },
  });
};
defineExpose({
  loadByBusId,
});
</script>
